package 剑指Offer.easy;

import javafx.util.Pair;

import java.io.*;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

public class 扑克牌中的顺子 {
    class Solution {
        public boolean isStraight(int[] nums) {
            Arrays.sort(nums);
            int i = 0;
            while (nums[i] == 0) i++;
            int sum = 0;
            for (int j = i + 1; j < nums.length; j++) {
                int sub = nums[j] - nums[j - 1];
                if (sub == 0) return false;
                sum += sub - 1;
            }
            return sum <= i;
        }
    }

    public static void main(String[] args) {
        Pair<Integer, String> map1 = new Pair<>(1, "lishuyu");
        Pair<Integer, String> map2 = new Pair<>(2, "ciakeyuan");

        System.out.println(map1.getKey() + ":" + map1.getValue());
        System.out.println(map2.getKey() + ":" + map2.getValue());
    }

}
